docs: Update Tauri/Rust API documentation to match current codebase#437
Conversation
Fixes AOSSIE-Org#358 - Change Tauri/Rust docs to match the current state of the repository - Updated outdated API documentation in docs/backend/backend_rust/api.md - Added 13 missing Tauri commands that were not documented: * share_file - File system integration * save_edited_image - Image processing with filters * get_server_path - Server resources path * move_to_secure_folder - Encrypted file storage * create_secure_folder - Secure folder creation * unlock_secure_folder - Secure folder authentication * get_secure_media - Secure media retrieval * remove_from_secure_folder - Secure file removal * check_secure_folder_status - Secure folder status * get_random_memories - Random memory images * open_folder - System folder operations * open_with - System 'Open With' dialog * set_wallpaper - Desktop wallpaper setting - Fixed parameter types for existing commands: * get_all_images_with_cache: directory -> directories (Vec<String>) * get_all_videos_with_cache: directory -> directories (Vec<String>) - Added comprehensive documentation sections: * Data structures (SecureMedia, MemoryImage) * Enhanced usage examples for all commands * Security features section explaining AES-256-GCM encryption * Cross-platform support information * Updated key components description The documentation now accurately reflects all 18 available Tauri commands instead of the previous 5, making it much easier for developers to understand and use the complete API.
WalkthroughThe Rust backend API documentation was extensively revised to reflect recent updates in the codebase. Command signatures were updated for multi-directory support, several new commands were documented, new data structures were introduced, and sections on security, system integration, and cross-platform support were added or expanded. Changes
Assessment against linked issues
Poem
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
docs/backend/backend_rust/api.md (2)
48-61: Consider collapsing the long parameter list into a struct
save_edited_imagenow exposes 11 primitive parameters. From both the JS and Rust perspectives this is brittle (easy to get ordering wrong, hard to evolve). A single settings object / struct (ImageEditOptions?) would be clearer and future-proof.No blocking change required, but worth tracking.
177-190: JS example: clarifyimage_dataencoding
Vec<u8>on the Rust side typically translates to a Base64‐encoded string over the invoke bridge, not a rawUint8Array. Add a short note or convert in the snippet:const imageBytesBase64 = await fileToBase64(file); // helper await invoke("save_edited_image", { image_data: imageBytesBase64, /* … */ });
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
docs/backend/backend_rust/api.md(3 hunks)
🔇 Additional comments (3)
docs/backend/backend_rust/api.md (3)
21-31: Vector-based parameter update looks goodThe wording now correctly reflects the new
Vec<String>argument and the return type remains intact. Nothing else to flag here.
220-232: Great to see security details called outExplicitly documenting AES-256-GCM, PBKDF2 and secure RNG usage is valuable for user trust. 👍
157-160: Fields must bepubfor Serde to serialize
MemoryImageis returned to the frontend. With private fields it failsserde::Serialize, causing runtime errors. Either mark the fieldspubor add explicit getters +#[serde(rename_all = "camelCase")]as needed.pub struct MemoryImage { - path: String, - created_at: DateTime<Utc>, + pub path: String, + pub created_at: DateTime<Utc>, }Likely an incorrect or invalid review comment.
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
docs/backend/backend_rust/api.md (2)
167-171: Add error handling to example invocationThe
invokecall may reject (invalid directory, IO error, etc.). Wrapping intry/catch(or.catch) makes the example production-ready and signals best practice to readers.try { const imagesData = await invoke("get_all_images_with_cache", { directories: ["/path/to/images1", "/path/to/images2"], }); // use imagesData } catch (e) { console.error("Failed to load images:", e); }
218-220: Minor consistency: capitalise component names uniformly
Secure Storage,Image Processing, andSystem Integrationare capitalised while preceding items (FileService,CacheService) are camel-cased. Pick one style to avoid visual noise.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
docs/backend/backend_rust/api.md(3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Backend Tests
- GitHub Check: Tauri Tests
|
Looks good! Thank you @Aditya30ag. |
|
Hi @rahulharpal1603 , thanks for merging the PR! I'm really interested in contributing more meaningfully to the project. Looking forward to staying connected and helping out wherever I can! |
Fixes #358 - Change Tauri/Rust docs to match the current state of the repository
Problem
The existing API documentation was severely outdated, listing only 5 commands while the actual codebase contains 18 commands.
Changes Made
✅ Added 13 Missing Commands:
share_file- File system integrationsave_edited_image- Image processing with filtersget_server_path- Server resources pathmove_to_secure_folder- Encrypted file storagecreate_secure_folder- Secure folder creationunlock_secure_folder- Secure folder authenticationget_secure_media- Secure media retrievalremove_from_secure_folder- Secure file removalcheck_secure_folder_status- Secure folder statusget_random_memories- Random memory imagesopen_folder- System folder operationsopen_with- System "Open With" dialogset_wallpaper- Desktop wallpaper setting✅ Fixed Existing Commands:
get_all_images_with_cacheandget_all_videos_with_cacheto acceptdirectories: Vec<String>instead ofdirectory: String✅ Enhanced Documentation:
SecureMedia,MemoryImage)Result
The documentation now accurately reflects all 18 available Tauri commands, making it much easier for developers to understand and use the complete API.
Testing
frontend/src-tauri/src/services/mod.rsSummary by CodeRabbit